cmake_minimum_required(VERSION 3.10.2)
project(kvdb)

set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++1y -fno-rtti -fvisibility=default -D_GNU_SOURCE")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fdata-sections -fPIC -fpic -ffunction-sections -D_GLIBC_MOCK")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wl,--no-as-needed -ldl")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wformat=0")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fprofile-arcs -ftest-coverage")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fprofile-arcs -ftest-coverage")
set(MOCK_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../../mock)
add_definitions(-DNAPI_EXPERIMENTAL)
aux_source_directory(${CMAKE_CURRENT_SOURCE_DIR}/innerkitsimpl/distributeddatafwk/src kvdbSrc)
aux_source_directory(${CMAKE_CURRENT_SOURCE_DIR}/innerkitsimpl/kvdb/src kvdbSrc)
aux_source_directory(${CMAKE_CURRENT_SOURCE_DIR}/innerkitsimpl/object/src kvdbSrc)
aux_source_directory(${CMAKE_CURRENT_SOURCE_DIR}/jskitsimpl/distributedkvstore/src kvdbSrc)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/jskitsimpl/distributedkvstore/include)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/innerkitsimpl/distributeddatafwk/include)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/innerkitsimpl/distributeddatafwk/src)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/innerkitsimpl/kvdb/include)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/innerkitsimpl/object/include)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/common)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../interfaces/innerkits/distributeddata/include)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../interfaces/innerkits)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../../datamgr_service/services/distributeddataservice/adapter/include)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../../datamgr_service/services/distributeddataservice/adapter/include/account)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../../datamgr_service/services/distributeddataservice/adapter/include/autils)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../../datamgr_service/services/distributeddataservice/adapter/include/broadcaster)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../../datamgr_service/services/distributeddataservice/adapter/include/communicator)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../../datamgr_service/services/distributeddataservice/adapter/include/dfx)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../../datamgr_service/services/distributeddataservice/adapter/include/log)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../../datamgr_service/services/distributeddataservice/adapter/include/permission)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../../datamgr_service/services/distributeddataservice/adapter/include/security)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../../datamgr_service/services/distributeddataservice/adapter/include/utils)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../../datamgr_service/services/distributeddataservice/service/crypto/include)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../frameworks/libs/distributeddb/include)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../frameworks/libs/distributeddb/interfaces/include)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../frameworks/libs/distributeddb/interfaces/include/relational)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../../data_share/interfaces/inner_api/common/include)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../../data_share/interfaces/inner_api/provider/include)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../../utils_native/base/include)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../../utils_native/safwk/native/include)
include(${MOCK_DIR}/include/CMakeLists.txt OPTIONAL)
set(links secure mock distributeddb)

add_library(kvdb SHARED ${kvdbSrc})
target_link_libraries(kvdb ${links})